extends layout

block content
  h2.page-header
    = category.name
    &nbsp;分类下的所有文章&nbsp;
    = posts.length

  each post in posts
    div.post
      h3.post-title
        a(href="/posts/view/" + post._id, target="_blank")
          =post.title
      div.post-abstract
        =truncate(post.content, 3)
      div.post-meta
        span.post-created 时间：
          =moment(post.created).format('YYYY-MM-DD')
        span.post-author 作者：
          =post.author.name
        span.post-category 分类：
          a(href="/posts/category/" + post.category.name, target="_blank")
            =post.category.name
        span.post-comment 评论：
          =post.comments.length || 0
        span.post-favorite 被赞：
          =post.meta.favorite || 0
        span.post-link
          a(href="/posts/view/" + post._id, target="_blank") 查看全文 